<%@ page import="nusarPruebas.Alumno" %>



<div class="fieldcontain ${hasErrors(bean: alumnoInstance, field: 'matricula', 'error')} required">
	<label for="matricula">
		<g:message code="alumno.matricula.label" default="Matricula" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="matricula" type="number" value="${alumnoInstance.matricula}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: alumnoInstance, field: 'nombre', 'error')} required">
	<label for="nombre">
		<g:message code="alumno.nombre.label" default="Nombre" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="nombre" required="" value="${alumnoInstance?.nombre}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alumnoInstance, field: 'carrera', 'error')} required">
	<label for="carrera">
		<g:message code="alumno.carrera.label" default="Carrera" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="carrera" from="${alumnoInstance.constraints.carrera.inList}" required="" value="${alumnoInstance?.carrera}" valueMessagePrefix="alumno.carrera"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alumnoInstance, field: 'correo', 'error')} required">
	<label for="correo">
		<g:message code="alumno.correo.label" default="Correo" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="email" name="correo" required="" value="${alumnoInstance?.correo}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alumnoInstance, field: 'password', 'error')} required">
	<label for="password">
		<g:message code="alumno.password.label" default="Password" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="password" required="" value="${alumnoInstance?.password}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alumnoInstance, field: 'coordinador', 'error')} required">
	<label for="coordinador">
		<g:message code="alumno.coordinador.label" default="Coordinador" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="coordinador" name="coordinador.id" from="${nusarPruebas.Coordinador.list()}" optionKey="id" required="" value="${alumnoInstance?.coordinador?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alumnoInstance, field: 'materias', 'error')} ">
	<label for="materias">
		<g:message code="alumno.materias.label" default="Materias" />
		
	</label>
	<g:select name="materias" from="${nusarPruebas.Materia.list()}" multiple="multiple" optionKey="id" size="5" value="${alumnoInstance?.materias*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: alumnoInstance, field: 'solicitudes', 'error')} ">
	<label for="solicitudes">
		<g:message code="alumno.solicitudes.label" default="Solicitudes" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${alumnoInstance?.solicitudes?}" var="s">
    <li><g:link controller="solicitud" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="solicitud" action="create" params="['alumno.id': alumnoInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'solicitud.label', default: 'Solicitud')])}</g:link>
</li>
</ul>

</div>

